#!/usr/bin/lua

require 'socket'
require 'copas'


local port=23

function mainfunc()
	local s=socket.tcp()
	local co_s=copas.wrap(s)
	local c=copas.connect(s,"127.0.0.1",port)
	print(c)
	co_s:send("{cmd='hi'}\r\n")
	local reply=co_s:receive()
	print(reply)
end



copas.addthread(mainfunc)
copas.loop()
